using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

namespace Mgrs
{
    /**界面管理 */
    public class PanelMgr
    {

        /**打开药箱界面 */
        public static void OpenKitPanel(Transform parent)
        {
            var panelKitPrefab = Resources.Load("Prefabs/Panels/Panel_kit", typeof(GameObject));
            Object.Instantiate(panelKitPrefab, parent);
        }
        
        //打开设置界面
        public static void OpenSetPanel(Transform parent)
        {
            var panelSetScenePrefab = Resources.Load("Prefabs/Panels/Panel_SetScene", typeof(GameObject));
            Object.Instantiate(panelSetScenePrefab, parent);
        }
        
        //打开草药本
        public static void OpenHerbPanel(Transform parent)
        {
            var panelHerbPrefab = Resources.Load("Prefabs/Panels/Panel_Herb", typeof(GameObject));
             var obj =  Object.Instantiate(panelHerbPrefab, parent) as GameObject;
             obj?.transform.Find("bgImage").GetComponent<HerbContorl>().OpenDiseadBook();
        }
        
        //打开病例本
        public static void OpenDiseasePanel(Transform parent)
        {
            var panelDiseasePrefab = Resources.Load("Prefabs/Panels/Panel_Herb", typeof(GameObject));
            Object.Instantiate(panelDiseasePrefab, parent);
        }
        
        //打开选路页面
        public static void OpenRoadPanel(Transform parent)
        {
            var panelEventCardControl = Resources.Load("Prefabs/Road/Panel_EventCardControl", typeof(GameObject));
            Object.Instantiate(panelEventCardControl, parent);
        }
        
        //打开背包页面
        public static void OpenBackpack(Transform parent)
        {
            var panelEventCardControl = Resources.Load("Prefabs/Knapsack/Panel_boxBackpack", typeof(GameObject));
            Object.Instantiate(panelEventCardControl, parent);
        }

    }
}
